package com.qf.day04.homework;


import java.util.Scanner;
/*
       判断是否为回文串
        */
public class Homework1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while(true){
        boolean flag=true;
        System.out.println("请输入文本");
        String text=scanner.next();
        char [] array=text.toCharArray();
        for (int i = 0; i < array.length/2; i++) {
            if(array[i]==array[array.length-i-1]){
                flag=true;
            }else{
                flag=false;
                break;
            }
        }
        if(flag==true){
            System.out.println("为回文串");
        }else{
            System.out.println("不为回文串");
        }
    }

    }
}
